'use strict';
const db = uniCloud.database()
const coll = db.collection('xinyuan')
exports.main = async (event, context) => {
	//sign是1的为审核通过的心愿列表 0的是未审核的 2是被拒绝的
	if (event.sign == 1) {
		let res1 = await coll.limit(1000).where({
			status: 1
		}).orderBy("zan", "desc").get()
		return res1
	} else if (event.sign == 0) {
		let res2 = await coll.limit(1000).where({
			status: 0
		}).get()
		return res2
	} else {
		let res3 = await coll.limit(1000).where({
			status: 0
		}).orderBy("zan", "desc").get()
		return res3
	}

};
